
function nop() { }

function initPatterns() {

    const hide = true;

    let all = [{
        name: "", label: "大三和弦", aliases: "M", steps: [4, 3]
    }, {
        name: "min", label: "小三和弦 (min)", aliases: "m", steps: [3, 4]
    }, {
        name: "aug", label: "增三和弦 (aug)", aliases: "", steps: [4, 4]
    }, {
        name: "dim", label: "减三和弦 (dim)", aliases: "", steps: [3, 3]
    }, {
        name: "dim7", label: "dim7", aliases: "", steps: [3, 3, 3]
    }, {
        name: "7-1", label: "7-x", aliases: "", steps: [3, 3, 4], hide
    }, {
        name: "m7", label: "minor 7th", aliases: "", steps: [3, 4, 3]
    }, {
        name: "mM7", label: "minor major 7th", aliases: "", steps: [3, 4, 4]
    }, {
        name: "7", label: "7th", aliases: "", steps: [4, 3, 3]
    }, {
        name: "maj7", label: "major 7th", aliases: "", steps: [4, 3, 4]
    }, {
        name: "7-6", label: "7-x", aliases: "", steps: [4, 4, 3], hide
    }, {
        name: "7-7", label: "多乱鱼", aliases: "", steps: [4, 4, 4], hide
    }, {

        name: "aug7", label: "aug7", aliases: "", steps: [4, 4, 2],
    }, {
        name: "m7b5", label: "m7b5", aliases: "", steps: [3, 3, 4],
    }, {
        name: "7+5", label: "7+5 (C7#5) altered", aliases: "", steps: [4, 4, 2],
    }, {
        name: "7-5", label: "7-5 (C7b5) altered", aliases: "", steps: [4, 2, 4],
    }, {
        name: "sus4", label: "sus4", aliases: "", steps: [5, 2],
    }, {
        name: "sus2", label: "sus2", aliases: "", steps: [2, 5],
    }, {
        name: "6", label: "6th", aliases: "", steps: [4, 3, 2],
    }, {
        name: "m6", label: "minor 6th", aliases: "", steps: [3, 4, 2],
    }, {
        name: "6/9", label: "6/9", aliases: "", steps: [4, 3, 2, 5],
    }, {
        name: "5", label: "5th", aliases: "", steps: [7],
    }, {
        hide
    }]


    let dst = []
    for (var i in all) {
        let item = all[i]
        if (item.hide) { continue }
        dst.push(item)
    }
    return dst
}

const default_patterns = initPatterns()

const state = {
    patterns: default_patterns
};

const mutations = {
};

const actions = {
    xxx(context) {
        nop(context)
    }
};

const getters = {
    patterns(state) {
        return state.patterns
    }
};


export default {
    name: "chord",
    namespaced: true,
    state, mutations, actions, getters
}
